/**
 * 
 */
package com.hstypay.demo.service;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hstypay.demo.dao.entity.HsUser;
import com.hstypay.demo.dao.mapper.HsUserMapper;
import com.hstypay.demo.dto.HsUserDTO;
import com.hstypay.demo.dto.HsUserMessageDTO;
import com.hstypay.demo.facade.HsUserMessageService;
import com.hstypay.demo.facade.HsUserService;
import com.hstypay.sandbox.support.BeanConvertHelper;

/**
 * @author admin
 *
 */
@Service
public class HsUserServiceImpl implements HsUserService{
	@Resource
	private HsUserMapper hsUserMapper;
	@Resource
	private HsUserMessageService hsUserMessageService;
	
	@Override
	public int insertUser(Map<String, Object> params) {
		// TODO Auto-generated method stub
		return hsUserMapper.insertUser(params);
	}

	@Override
	public HsUserDTO queryUserById(Long id) {
		// TODO Auto-generated method stub
		HsUser hsUser = hsUserMapper.queryUserById(id);
		return BeanConvertHelper.copyProperties(hsUser, HsUserDTO.class);
	}

	@Override
	public List<HsUserMessageDTO> getUserMessage(Long userId) {
		// TODO Auto-generated method stub
		return hsUserMessageService.queryByUserId(userId);
	}
}
